import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'home',
        redirect: '/sys-admin',
        component: HomeView,
        children: [
            /*用户管理*/
            {
                path: '/sys-admin',
                component: () => import( '../views/sys-admin/AdminIndexView.vue')
            },
            {
                path: "/sys-admin/temp/user/list",
                component: () => import('../views/sys-admin/temp/UserListView.vue')
            },

            {
                path: "/sys-admin/temp/user/list/add-new",
                component: () => import( '../views/sys-admin/temp/UserAddNewView.vue')
            },
            /*修改用用户*/
            {
                path: "/sys-admin/temp/user/list/update",
                component: () => import( '../views/sys-admin/temp/UserUpdateView.vue')
            },
            /*用户中心*/
            {
                path: "/sys-admin/temp/user/list/userinfo",
                component: () => import( '../views/sys-admin/temp/UserView.vue')
            },
            {
                path: "/sys-admin/temp/log/list",
                component: () => import( '../views/sys-admin/temp/LogListView.vue')
            },
            /*角色列表*/
            {
                path: "/sys-admin/temp/role/list",
                component: () => import('../views/sys-admin/temp/RoleListView.vue')
            },
            /*添加角色*/
            {
                path: "/sys-admin/temp/role/list/add-new",
                component: () => import( '../views/sys-admin/temp/RoleAddNewView.vue')
            },
            /*修改角色*/
            {
                path: "/sys-admin/temp/role/list/update",
                component: () => import( '../views/sys-admin/temp/RoleUpdateView.vue')
            },
            /*销售*/
            {
                path: "/sys-sales/temp/customer/list",
                component: () => import('../views/sys-sales/temp/CustomerListView.vue')
            },
            {
                path: "/sys-sales/temp/customer/add-new",
                component: () => import('../views/sys-sales/temp/CustomerAddNewView.vue')
            },
            {
                path: "/sys-sales/temp/sales/add-new",
                component: () => import('../views/sys-sales/temp/SalesAddNewView.vue')
            },
            {
                path: "/sys-sales/temp/sales/list",
                component: () => import('../views/sys-sales/temp/SalesListView.vue')
            },
            /*商品管理*/
            {
                path: "/sys-product/temp/product/list",
                component: () => import('../views/sys-product/temp/ProductListView.vue')
            },
            /*新增商品*/
            {
                path: "/sys-product/temp/product/add-new1",
                component: () => import('../views/sys-product/temp/ProductAddNewStep1View.vue')
            },
            {
                path: "/sys-product/temp/product/add-new2",
                component: () => import('../views/sys-product/temp/ProductAddNewStep2View.vue')
            },
            /*类别列表*/
            {
                path: "/sys-product/temp/category/list",
                component: () => import('../views/sys-product/temp/CategoryListView.vue')
            },
            {
                path: '/sys-admin/other',
                component: () => import( '../views/sys-admin/OtherView.vue')
            },

        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/loginView.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
